package com.liuyingxing.javaSpringCloudAccount.util;

import org.apache.commons.lang3.StringUtils;
import org.springframework.util.DigestUtils;

/**
 * Created by IntelliJ IDEA.
 * @File MD5Util.java
 * @Auth liuxing
 * @Date 2021/8/26 14:32
 * @Email liuxing997@foxmail.com
 */
public class MD5Util {
    private static final String SALT = "&%5123***&&%%$$#@";

    public static String getMD5(String password) {
        if (StringUtils.isBlank(password)) {
            return null;
        }
        String base = password + "/" + SALT;
        return DigestUtils.md5DigestAsHex(base.getBytes());
    }

    public static void main(String[] args) {
        System.out.println(MD5Util.getMD5("111111"));
    }
}
